package com.situ.mall.controller.front;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.situ.mall.pojo.entity.Product;
import com.situ.mall.service.IProductService;

@Controller
@RequestMapping("/detail")
public class FrontDetailController {
	@Autowired
	private IProductService productService;
	
	
	@RequestMapping("/getDetailPage.shtml")
	public String getDetailPage(Integer productId, Model model) {
		Product product = productService.selectProductById(productId);
		model.addAttribute("product", product);
		return "front/goods-detail";
	}
}
